#if UNITY_EDITOR

using UnityEditor;
using UnityEngine;

namespace FutureCoreDesign
{
    /// <summary>
    /// GameView's Camera Add This Component
    /// </summary>
    public class SyncSceneViewCamera : MonoBehaviour
    {
        private SceneView view = null;

        private void Awake()
        {
            view = SceneView.lastActiveSceneView;
        }

        private void LateUpdate()
        {
            if (view != null)
            {
                view.LookAt(transform.position, transform.rotation, 0f);
            }
        }

        private void OnDestroy()
        {
            if (view != null)
            {
                view.LookAt(transform.position, transform.rotation, 5f);
            }
        }
    }
}

#endif